#ifndef __LIGHTSOURCE_RENDERER_H__
#define __LIGHTSOURCE_RENDERER_H__

#include <shader.hpp>

struct CamInfo {
    glm::vec3 camPos;
    glm::mat4 view;
    glm::mat4 projection;
};

class LightSource {
private:
    Shader shaderObj;
public:
    LightSource(std::string bp);
    bool ready();
    void use();
    void setCameraInfo(CamInfo &camInfo);
    void setLightColor(glm::vec3 &color);
    void setModelMat(glm::mat4 &modleMat);
};
LightSource::LightSource(std::string bp) : shaderObj( (bp + "\\lightsource_vs.glsl").c_str(), (bp + "\\lightsource_fs.glsl").c_str()){}
bool LightSource::ready()
{
    return shaderObj.ready();
}
void LightSource::use()
{
    shaderObj.use();
}
void LightSource::setCameraInfo(CamInfo &camInfo)
{
    shaderObj.setMat4("viewMat", camInfo.view);
    shaderObj.setMat4("projMat", camInfo.projection);
}
void LightSource::setModelMat(glm::mat4 &modleMat)
{
    shaderObj.setMat4("modelMat", modleMat);
}
void LightSource::setLightColor(glm::vec3 &color)
{
    shaderObj.setVec3("lightColor", color);
}

#endif